package org.jetnuke.util;

import org.apache.log4j.Logger;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContext;

public class GetStyles {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(GetStyles.class);

	private GetStyles() {
	};

	public static List getStyles(ServletContext sc) {
		if (logger.isDebugEnabled()) {
			logger.debug("getStyles(ServletContext) - start"); //$NON-NLS-1$
		}

		List styleList = null;

		try {
			styleList = GetResources.getDirectories(sc, "/style/");
		} catch (Throwable e) {
			logger.error("getStyles(ServletContext)", e); //$NON-NLS-1$

			styleList = new ArrayList();
			styleList.add("NukeNews");
		}

		if (logger.isDebugEnabled()) {
			logger.debug("getStyles(ServletContext) - end"); //$NON-NLS-1$
		}
		return styleList;
	}
}
